package com.koron.standard.deviceClasssify.bean.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.koron.standard.bean.base.LogicBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 设备分类基本信息(Type)表实体类
 *
 * @author jzp
 * @since 2021-07-13 17:13:25
 */
@Data
@TableName("c_type")
@ApiModel(value = "设备分类基本信息", description = "Type")
public class Type extends LogicBean {

    @ApiModelProperty(value = "分类编码，如007001004")
    private String code;

    @ApiModelProperty(value = "分类名称")
    private String name;

    @ApiModelProperty(value = "父级设备分类id")
    private String parentId;

    @ApiModelProperty(value = "父级名称")
    private String parentName;

    @ApiModelProperty(value = "层级，如3")
    private Integer level;

    @ApiModelProperty(value = "层级编码，如4")
    private Integer levelCode;

    @ApiModelProperty(value = "层级路径，如7/1/4")
    private String levelPath;

    @ApiModelProperty(value = "专业,common_major")
    private String major;

    @ApiModelProperty(value = "命名规则")
    private String named;

    @ApiModelProperty(value = "是否虚拟节点。0实体节点，1虚拟节点")
    private Integer isVirtual;

    @ApiModelProperty(value = "基本参数组ID(c_type_group.id)")
    private String groupId;

    @TableField(value="`sort`")
    @ApiModelProperty(value = "调整参数顺序，如3")
    private Integer sort;

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Type) {
            return this.getId().equals(((Type) obj).getId());
        }
        return false;
    }

    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }

}